var mysql = require('mysql')
var co = mysql.createConnection({
    host: '119.45.34.210',
    user: 'root',
    password: '123456',
    port: '3306',
    database: 'book'
})

co.connect();

const sql = 'SELECT * FROM book_list';

co.query(sql, (err, result, filelds) => {
    // console.log(err, result, filelds)
    if (err) throw err
    console.log('[select] succeed!')
    console.log('book_list:', result.length, result)
});

co.end((err) => {
    if (err) throw err;
    console.log('[connenct end] succeed!')
});

// console.log('sql')
